<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width" />
        <link href="css/font-awesome.css" rel="stylesheet" type="text/css" />
        <link href="css/ODMS.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="css/all-page.css"/>
        <title>E-Top 在线文档管理系统</title>
        <script src="js/jquery-1.11.2.js"></script>
        <script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
        <script src="js/home-page.js"></script>
    </head>
    <body class="all-page home-page
          <c:if test="${not empty loginUser}">logined</c:if>
          <c:if test="${loginUser.role eq 2}">manage-logined</c:if>
              ">
              <script>
//                  window.onload = init;
//                  function init() {
//                        alert(window.location);
////                        解码成功，对应的编码函数escape()；他不对+编码
//                        alert(unescape(window.location));//成功& =，失败中文编码
////                        解码失败，对应的编码函数encodeURI();不对单引号编码
//                        alert("1"+decodeURI(window.location));//成功中文编码，失败 & =
////                        解码成功，对应的编码函数encodeURIComponent();几乎对所有字符编码，不对.编码
//                        alert("2"+decodeURIComponent(window.location));//成功中文编码 & =，
//                  }
              </script>
              <!--顶部登陆注册框-->
          <jsp:include page="/WEB-INF/inc/header.jsp"/>

          <div class="document-list">
              <ul class="document-list-ul">
                  <c:forEach var="docu" items="${docuList.datas }" >
                      <li class="document-list-li">
                          <a href="Visitor_onlineBrowse?docuId=${docu.id }" target="_blank" class="word">
                              <span class="fa fa-file-powerpoint-o"></span>
                              ${docu.name }
                          </a>
                          <div class="user-mark">
                              <span>用户评价:</span>
                              <span>
                                  <i class="i11 fa fa-star"></i>
                                  <i class="i12 fa fa-star"></i>
                                  <i class="i13 fa fa-star"></i>
                                  <i class="i14 fa fa-star"></i>
                              </span>
                          </div>
                          <div class="word-state">
                              <span class="state-span1">浏览量: <em>${docu.views }</em></span>
                              <span class="state-span2">下载量: <em>${docu.downtotal }</em></span>
                              <span class="state-span3">上传时间: <em><fmt:formatDate value="${docu.upDate}" type="date"/></em></span>
                          </div>
                          <div class="use-word">
                              <a href="Userdownload?docuId=${docu.id }" class="use-a1">
                                  <i class="i111 fa fa-cloud-download"></i>
                                  <span>下载</span>
                              </a>
                              <a href="#" class="use-a2">
                                  <i class="i112 fa fa-star"></i>
                                  <span>收藏</span>
                              </a>
                              <a href="#" class="use-a3">
                                  <i class="i113 fa fa-comment"></i>
                                  <span>举报</span>
                              </a>
                          </div>
                      </li>
                  </c:forEach>
              </ul>
              <pg:pager maxPageItems="${docuList.pageSize }" items="${docuList.totalRecord }" export="curPage=pageNumber" url="search">
                  <c:forEach items="mothod,name" var="p">
                      <pg:param name="${p}"/>
                  </c:forEach>


                  <div class="word-number">
                      <pg:last>
                          <!--以上是对文档列表的构架-->
                          <!--文档数量提示 、以及上下页的翻看-->
                          <div class="reminding-text">
                              找到文档${docuList.totalRecord }篇,共${pageNumber }页
                          </div>
                      </pg:last>
                      <div class="word-number-div">
                          <pg:first>
                              <a href="${pageUrl }">首页</a>
                          </pg:first>
                          <pg:prev><a href="${pageUrl }" target="_parent" class="reminding-a0">
                                  <span class="fa fa-angle-left"></span>上一页</a>
                              </pg:prev>
                              <pg:pages>
                                  <c:if test="${curPage eq pageNumber }">
                                  <a  class="reminding-a2">${curPage }</a>
                              </c:if>
                              <c:if test="${curPage ne pageNumber }">
                                  <a href="${pageUrl }" target="_parent" class="reminding-a1">
                                      ${pageNumber }</a>
                                  </c:if>
                              </pg:pages>
                              <pg:next> <a href="${pageUrl }"  target="_parent" class="reminding-a00">下一页
                                  <span class="fa fa-angle-right"></span></a>
                              </pg:next>
                              <pg:last> 
                              <a href="${pageUrl }" >尾页</a>
                          </pg:last>

                      </div>
                      <div class="footer">
                          <a href="Userlogmain" target="_blank">E-Top</a>
                      </div>
                  </div>
              </pg:pager>
          </div>
          <jsp:include page="/WEB-INF/inc/footer.jsp"/>
    </body>
</html>
